#{extends 'CRUD/layout.html' /}
#{set title:messages.get('crud.show.title', type.modelName) /}

<div id="crudShow" class="${type.name}">

    <h2 id="crudShowTitle">&{'crud.show.title', type.modelName}</h2>

    <div class="objectForm">
    #{form action:@saveCustom(object._key(), object.nick), enctype:'multipart/form-data'}
        #{crud.form}
                #{crud.custom 'dateBegin'}
                    <label for="dateBegin">Fecha de Inicio</label>
                    <input id="dateBegin" name="object.dateBegin" value="${object.dateBegin}"/>
                #{/crud.custom}
                #{crud.custom 'dateEnd'}
                    <label for="dateEnd">Fecha de Cierre</label>
                    <input id="dateEnd" name="object.dateEnd" value="${object.dateEnd}"/>
                #{/crud.custom}
        #{/crud.form}
        <p class="crudButtons">
            <input type="submit" name="_save" value="&{'crud.save', type.modelName}" />
            <input type="submit" name="_saveAndContinue" value="&{'crud.saveAndContinue', type.modelName}" />
        </p>
    #{/form}
    </div>

    #{form @delete(object._key())}
        <p class="crudDelete">
            <input type="submit" value="&{'crud.delete', type.modelName}" />
        </p>
    #{/form}
</div>

    <script>
        $(function() {
            $( "#dateBegin" ).datepicker({"dateFormat": 'yy-mm-dd'});
            $( "#dateEnd" ).datepicker({"dateFormat": 'yy-mm-dd'});
        });
	</script>